/***
  doImgServer.java is part of Marioneta.

  Marioneta is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License.

  Marioneta is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
  
  @author martin
   Martin Edmundo Barriga Orozco, 2008
   martin.barriga@gulmore.org
  
  doImgServer:
 */

package escritorioremoto;

import java.net.ServerSocket;
import java.net.Socket;
import java.io.IOException;

public class doImgServer {
    private ServerSocket imgServer;
    private int port;
    
    public doImgServer(int port){
        try{
            this.port = port;
            imgServer = new ServerSocket( this.port );
        }
        catch(IOException e){
            System.out.println("No se puede inicializar la interfaz del servidor de imagenes: " + e.getMessage());
        }
    }
    
    public Socket getSocket(){
        Socket sd = null;
        try{
            sd = imgServer.accept();
        }
        catch(IOException e){
            System.out.println("No se pudo aceptar la conexion de imgenes: " + e.getMessage());
        }
        return sd;
    }
    
}
